class Solution {
public:
    string path;
    string alpha[11] = { "","","abc","def","ghi","jkl","mno","pqrs","tuv","wxyz" };
    vector<string> ret;
    vector<string> letterCombinations(string digits) {
        if (digits == "")return ret;
        dfs(digits, 0);
        return ret;
    }
    void dfs(const string& digits, int pos) {
        if (pos == digits.size()) {
            ret.push_back(path);
            return;
        }
        int index = digits[pos] - '0';
        for (int i = 0; i < alpha[index].size(); i++) {
            path.push_back(alpha[index][i]);
            dfs(digits, pos + 1);
            path.pop_back();
        }
    }

};